package cn.jiyun.controller;

import cn.jiyun.config.UserProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class UserController {

    @Autowired
    private UserProperties userProperties;

    @GetMapping("/getUser")
    public Map<String,Object> getUser(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("name",userProperties.getName());
        map.put("password",userProperties.getPassword());
        map.put("age",userProperties.getAge());
        map.put("hobby",userProperties.getHobby());
        return map;
    }
}
